package com.winterchen.utils;

import com.winterchen.log.LogEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @className LogUtils
 * @Description TODO
 * @Author Administrator
 * @Date 2018/9/12 0012 17:32
 * @Version 1.0
 **/
public class LogUtils {
    /**
     * 获取业务日志logger
     *
     * @return
     */
    public static Logger getBussinessLogger() {
        return LoggerFactory.getLogger(LogEnum.BUSSINESS.getCategory());
    }

    /**
     * 获取平台日志logger
     *
     * @return
     */
    public static Logger getPlatformLogger() {
        return LoggerFactory.getLogger(LogEnum.PLATFORM.getCategory());
    }

    /**
     * 获取数据库日志logger
     *
     * @return
     */
    public static Logger getDBLogger() {
        return LoggerFactory.getLogger(LogEnum.DB.getCategory());
    }


    /**
     * 获取异常日志logger
     *
     * @return
     */
    public static Logger getExceptionLogger() {
        return LoggerFactory.getLogger(LogEnum.EXCEPTION.getCategory());
    }


    /*
    * @Description: 在Controller中的具体调用
    * @param
    * @Return:
    * @Author: 张峻豪
    * @Date: 2018/9/12 0012 17:34
    */

    /*@GetMapping("/helloworld")
    public String helloworld() throws Exception{
        Logger log = LogUtils.getExceptionLogger();
        Logger log1 = LogUtils.getBussinessLogger();
        Logger log2 = LogUtils.getDBLogger();
        userService.queryUser();
        log.error("getExceptionLogger===日志测试");
        log1.info("getBussinessLogger===日志测试");
        log2.debug("getDBLogger===日志测试");
        return "helloworld";
    }*/

}
